package com.hpq.chat.service;


import com.hpq.chat.domain.dto.MsgReadInfoDTO;
import com.hpq.chat.domain.model.Message;
import com.hpq.chat.domain.vo.request.*;
import com.hpq.chat.domain.vo.request.member.MemberReq;
import com.hpq.chat.domain.vo.request.msg.ChatMessageBaseReq;
import com.hpq.chat.domain.vo.request.msg.ChatMessageMarkReq;
import com.hpq.chat.domain.vo.response.msg.ChatMessageReadResp;
import com.hpq.chat.domain.vo.response.msg.ChatMessageResp;
import com.hpq.common.domain.vo.response.CursorPageBaseResp;
import com.hpq.websocket.domain.vo.response.ChatMemberResp;

import javax.annotation.Nullable;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;

/**
 * Description: 消息处理类
 * */
public interface ChatService {

    /**
     * 发送消息
     *
     * @param request
     */
    Long sendMsg(ChatMessageReq request, Long uid);

    ChatMessageResp getMsgResp(Message message, Long receiveUid);

    /**
     * 根据消息获取消息前端展示的物料
     *
     * @param msgId
     * @param receiveUid 接受消息的uid，可null
     * @return
     */
    ChatMessageResp getMsgResp(Long msgId, Long receiveUid);

    CursorPageBaseResp<ChatMessageResp> getMsgPage(@Valid ChatMessagePageReq req, Long uid);

    void recallMsg(Long uid, @Valid ChatMessageBaseReq req);
    void setMsgMark(Long uid, ChatMessageMarkReq request);

    CursorPageBaseResp<ChatMessageReadResp> getReadPage(@Valid ChatMessageReadReq req, Long uid);

    Collection<MsgReadInfoDTO> getMsgReadInfo(Long uid, @Valid ChatMessageReadInfoReq request);

    void msgRead(Long uid, @Valid ChatMessageMemberReq request);

    CursorPageBaseResp<ChatMemberResp> getMemberPage(List<Long> memberUidList, MemberReq request);
}
